package cn.meebook.domain;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

/**
 * 咪书网用户。
 * 
 * @author 王帆
 *
 */
@Entity
public class Meeker implements Serializable {

	private static final long serialVersionUID = -3275926763891245389L;
	
	@Id
    @GeneratedValue(strategy=GenerationType.AUTO)
	private Long id;
	
	private String name;
	private String nickname;
	
	@ManyToMany
	@JoinTable(name="circle_members")
	private List<Circle> circles;
	
	protected Meeker() {
		
	}
	
	public Meeker(String name, String nickname) {
		this.name = name;
		this.nickname = nickname;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public List<Circle> getCircles() {
		return circles;
	}

	public void setCircles(List<Circle> circles) {
		this.circles = circles;
	}

	@Override
	public String toString() {
		return "Meeker [name=" + name + ", nickname=" + nickname + "]";
	}

}
